bs_sheepdog.c: fix pthread rwlock leak in sd_io()

The current sd_io function exits without unlocking pthread rwlock in
the error path.  This fixes the leak bug.

Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Reviewed-by: Hitoshi Mitake <mitake.hitoshi@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
bs_sheepdog.c: fix memory leak issues in sd_open()

This fixes memory leak issues in sd_open function which were brought
by the patch titled "bs_sheepdog.c: support various VDI options in
--backing-store option" (commit:
f282f83c036e298f316ef64d1e51aff3f57b9eaf).

The current sd_open function doesn't free locally allocated string
"orig_filename" nor restores "filename" argument temporarily broken
for parsing VDI options when unknown protocol was specified or tcp
port number was malformed.

Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Reviewed-by: Hitoshi Mitake <mitake.hitoshi@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>