Suicide attack on Afghan mosque kills 39