nbd-server: fix dosockopts() to report errors
The purpose of this change is to separate error reporting from error
handling and hence make dosockopts() usable also in other calling
contexts. dosockopts() reports errors in setting socket options and then
it's up to the caller to decide how to react to those errors.
This is a step towards more uniform and robust error management. Similar
changes needs to be done to other functions as well.
Signed-off-by: Tuomas Jorma Juhani Räsänen <tuomasjjrasanen@tjjr.fi>