Add a -p option to choose which printer the print server controls

When not using UCI to obtain the configuration settings, a dummy
variable forces a makerbot (or whatever printer) as default. Using -p
one of the available printers can be configured via the commandline.
When -p is not supplied, uci (or the dummy var) is used instead.

Missing still is to print the list of available printers when using -p
help or an empty -p. Since there is a function in the 'TODO' area to
print a list of printers, this item is also TODO.

Signed-off-by: Olliver Schinagl <o.schinagl@ultimaker.com>
Require a device ID for several actions, fixes segfault

THe AT_GET_TEST an AT_GET_PROGRESS actions require a device ID when,
also when called from -g. If this is not done, calling these actions via
-g causes segfaults.

Signed-off-by: Olliver Schinagl <o.schinagl@ultimaker.com>
Fix segfault when doing serial communication.

The serial module does not account for the \0 character when mallocing.
Request 1 extra byte of memory to account for \0.

Signed-off-by: Olliver Schinagl <o.schinagl@ultimaker.com>
Use getopt's api as intended, store the return value in an int, not char

getopt returns an integer which is -1 when there is no more options left to be parsed.
Currently this result is stored in a char, which by definition is undefined whether
it is signed or unsigned. On ARM it may be unsigned and thus -1 never happens.

Signed-off-by: Olliver Schinagl <o.schinagl@ultimaker.com>