European stocks end Thursday with gains