Lexmark to buy Kofax for about $1B to boost software business