gyp: add osmesa target to factor out common code

Test this out with `GYP_DEFINES=skia_mesa=1`.

Also uses the `library_dirs` keyword, which is relatively new.
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1903233002

Review URL: https://codereview.chromium.org/1903233002
2 files changed