Fix fd leak and blind IO#gets in pwdump import

## Verify
- [ ] Save the following to `/tmp/pwdump-test.txt`
```
# Metasploit PWDump Export v1
# Generated: 2014-05-13 17:57:19 UTC
# Project: LoadTesting
# 
########################################
# SMB Hashes (1 services, 1 hashes)
# 114.144.78.235:22/tcp (ssh)
Hashy:3:hashhaashery:::
########################################
# SSH Private Keys (1 services, 1 keys)
# 114.144.78.235:22/tcp (ssh)
Warning: missing SSH key file 'kljsdlkfjfkl;jasdf;lkasjdf;lkjasdf;lkjasdf;lkj'.
########################################
# SSH Public Keys (0 services, 0 keys)
# No credentials for this type were discovered.
########################################
# Plaintext Credentials (3 services, 3 credentials)
# 114.144.78.235:22/tcp (ssh)
anothertest super
# 114.144.78.235:512/tcp (rexec)
test1 yay
# 121.7.59.41:23/tcp (telnet)
admin yklj;k;lk;lsd
########################################
```
- [ ] `./msfconsole`
- [ ] `workspace -a PwdumpTest`
- [ ] `db_import -f pwdump /tmp/pdump-test.txt`
- [ ] Verify: the import completes without errors
- [ ] `irb`
- [ ] Verify: `Metasploit::Credential::Core.where(workspace: Mdm::Workspace.last).count == 4`