make sure createInputScript convert pubKey to buffer before writing out bytes

[fixes #156]