Fixed an issue with item_db2 entries that specify Inherit, and no Script

- Added missing source documentation for the itemdb overhaul related
  functions.
- Slighty refactored the readdb sql function.
- Special thanks to sevenzz23 for reporting the crash issue (topic:3029)
  http://hercules.ws/board/topic/3029-ritem-data-structure-overhaul-error-msg/
  and to Ind for testing.

Signed-off-by: Haru <haru@dotalux.com>