spain was invaded by napoleon