nasmlib: Introduce nasm_trim_spaces and nasm_opt_val helpers