The high-redshift gamma-ray burst GRB 140515A - A comprehensive X-ray and optical study