Resolved the bugs for MySQL upload

- implemented NULL value for all possible foreign key conflicts
- resolved rawlocation problem: should be written separately for every
file, not every patent level
- added checkup on whether rawlocation_id exists before uploading new
data (say, you already uploaded 1976-2001 and then another sample
2002-2004 - could be duplicate locations, need to check with DB before
uploading)
- updated 2002-2004 to capture application number correctly
- tested on sample 1976-2001 and 2002-2004 data