Fix some error cases to raise Net::SCP::Error instead of RuntimeError

and add tests